<?php

namespace frontend\assets;

use yii\web\AssetBundle;

/**
 * Main frontend application asset bundle.
 */
class WenmingAsset extends AssetBundle
{
//    public $basePath = '@webroot';
    public $sourcePath = '@app/assets/wenming';
//    public $baseUrl = '@web';
    public $css = [
        'css/page.css',

    ];
    public $js = [
        'js/jquery-1.7.1.min.js',
        'js/jquery.jdt.js',
        'js/main.js',
        'js/webdig_test.js',

        //附件上传
        'js/swfupload/swfupload.js',
        'js/swfupload/fileprogress.js',
        'js/swfupload/handlers.js',
        //'js/dialog.js', //没有找到该js文件
        'js/ajaxupload.js',
    ];
    public $depends = [
        'yii\web\YiiAsset',
        //'yii\bootstrap\BootstrapAsset',
    ];
    //定义按需加载JS方法，注意加载顺序在最后
    public static function addScript($view,$jsfile) 
    {
        $view->registerJsFile($jsfile,[WenmingAsset::className(),'depends'=>'backend\assets\WenmingAsset']);
    }

    //定义按需加载CSS方法，注意加载顺序在最后
    public static function addCss($view,$cssfile)
    {
        $view->registerCssFile($cssfile,[WenmingAsset::className(),'depends'=>'backend\assets\WenmingAsset']);
    }
}
